
var DataItem = cc.Class({
    name: 'DataItem',
    properties: {
        itemID  : 0,
        itemName: "",
        itemPrice: 0,
    }
});

cc.Class({
    extends: cc.Component,

    properties: {
        _datatable:{
            default: [],
            type:[DataItem],
        }
    },

    // use this for initialization
    onLoad: function () {
        this.loadDataTable();
    },

    loadDataTable: function (){
        var item0 = new DataItem();
        item0.itemID = 0;
        item0.itemName = "name0";
        item0.itemPrice = 0;
        this._datatable[0] = item0;
        console.log("table size0 = " + this._datatable.length);
        var item1 = {
            itemID:1,
            itemName:"name0",
            itemPrice:1,
        };
        this._datatable[1] = item1;//.push(item1);
        console.log("table size1 = " + this._datatable.length);
    },
    getLocalTable: function () 
    {
        console.log("return local table ")
        return this._datatable;
    },
});
